<?php
function main()
{
    ob_end_clean();
    ob_implicit_flush(true);

    $boundary="ThisRandomString";
    header("Content-type:multipart/x-mixed-replace;boundary=$boundary");
    print "--$boundary\n";
    for($i=0; ; ++$i)
    {
        print <<<EOD
Content-type:text/xml;charset=utf-8

<?xml version="1.0" encoding="utf-8"?>
<info>
<id>$i</id>
<name>阿隆</name>
</info>
--$boundary

EOD
;
        sleep(2);
    }
    print "--$boundary--\n";
}

$code=main();
exit($code);
?>
